import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;


public abstract class AbstractElement {
	public ArrayList<AbstractElement> filhos = new ArrayList<AbstractElement>();

	public String type;
	public String value;

	public abstract Object interpret(RobotActions robot);
	
	public static Method getMethod(String method_name, RobotActions robot) {
		
		Method method = null;
		
		Class<? extends RobotActions> cls = robot.getClass();
		
		
		Method[] meth = cls.getMethods();
		for(Method m: meth){
			if (m.getName().equals(method_name)) {
				method = m;
				break;
			}
		}
		
		
		return method;
		
	}
}
